package edu.nd.learn.day01;

import java.util.HashMap;

/**
 * @author 布衣
 */
public class FrogJumpWell {

    /**
     * 跳井问题
     *
     * @param wellHeight 井深
     * @param frogJump   跳几米
     * @param down       下滑几米
     * @return 次数
     */
    public static int jump(int wellHeight, int frogJump, int down) {
        int n = 0;int pos = 0;
        for (; (pos += frogJump) <= wellHeight;n++,pos-=down ) {
        }
        return n;
    }

    public static void main(String[] args) {
        System.out.println(FrogJumpWell.jump(7, 3, 1));
    }

}
